package test_3_7;

import java.util.Scanner;

public class three {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        int sum=sum(a);
        System.out.println(sum);
    }
    public static int sum(int a)
    {
        int sum=0;
        if(a<=9)
            return a;
        else
        {
           return a%10+sum(a/10);
        }
    }
}
